<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../libs/vue.js"></script>
</head>
<body>
    <div id="app">
        <h1>计算属性：{{fullName}}</h1>
        <h1>计算属性：{{fullName}}</h1>
        <hr>
        <h1>方法：{{getFullName()}}</h1>
        <h1>方法：{{getFullName()}}</h1>
    </div>
    <script>
        let vm = new Vue({
            el:'#app',
            data:{
                firstName:'张',
                lastname:'三'
            },
            computed:{
                fullName(){
                    console.log(1)
                    return this.firstName + this.lastname
                }
            },
            methods: {
                getFullName(){
                    console.log(2)
                    return this.firstName + this.lastname
                }
            },
        })
    </script>
</body>
</html>